<?php
class Zendvn_View_Helper_CmsLableSort extends Zend_View_Helper_Abstract{
	
	public function cmsLableSort($lable,$ssFilter,$colum,$linkSort,$linkImgSort,$defaultOrder = 'DESC'){
		if($ssFilter['colum'] != $colum){
			$linkOrder = $linkSort.'/colum/'.$colum.'/by/'.$defaultOrder;
			$xhtml= '<a href="'.$linkOrder.'" title="Sort Z-A">
					'.$lable.'
					</a>';                         	
		}else{
			if($ssFilter['by']=='DESC'){
				$by = 'ASC';
				$iconOrder = $linkImgSort.'/arrow_down.png';
				$title="Sort A-Z";
			}else{
				$by = 'DESC';
				$iconOrder = $linkImgSort.'/arrow_up.png';
				$title= "Sort Z-A";
			}
			$linkOrder = $linkSort.'/colum/'.$colum.'/by/'.$by;
			$xhtml = '<a href="'.$linkOrder.'" title ="'.$title.'">
	              '.$lable.'<img src="'.$iconOrder.'"/>
	              </a>';
		}
		return $xhtml;
	}
}